#/bin/bash
# 导入配置 编译依赖 脚本
source ./config.sh
# 设置环境变量
cd ..
WORK_DIR=$(pwd)
# 设置构建目录 build
BUILD_DIR=${WORK_DIR}/build
# 判断 build 文件夹是否存在
if [ ! -d ${BUILD_DIR} ]; then
    mkdir -p ${BUILD_DIR}
fi

# ndk 主目录
NDK=$BUILD_DIR/android-ndk-r21e
# 设置编译工具链
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
# 设置系统跟目录
SYSTEMROOT=$TOOLCHAIN/sysroot
# NDK 版本
API=21


# arm-v7a
CPU=armv7-a
ARCH=arm
ARCH_TYPE=armv7a-linux-androideabi
host=armv7a-linux-android
CROSS=arm-linux-androideabi-
# 编译 x264
config_x264

# arm-v7a
CPU=armv7-a
ARCH=arm
ARCH_TYPE=armv7a-linux-androideabi
CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
config_ffmpeg










# arm64
CPU=armv8-a
ARCH=arm64
ARCH_TYPE=aarch64-linux-android
host=aarch64-linux-android
CROSS=aarch64-linux-android-
# 编译 x264
config_x264
# arm64
CPU=armv8-a
ARCH=arm64
CFLAGS="-march=armv8-a"
ARCH_TYPE=aarch64-linux-android
config_ffmpeg













